package a.j;

import a.c.ab;
import a.c.bb;
import a.c.d;
import a.c.e;
import a.c.m;
import a.c.v;
import a.c.y;
import a.j.a.b;
import a.j.a.j;

import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.geom.Rectangle2D;
import java.util.*;
import java.util.List;

public class yf
  extends gf
{
  private double m;
  private double G;
  private double H;
  private double I;
  private boolean J;
  private bb K;
  private List L;
  private Cursor M;
  private int N;
  private static final byte O = 1;
  private static final byte P = 2;
  private static final byte Q = 4;
  private ab R;
  private z S;
  private boolean T;
  private byte U = 1;
  public static final byte V = 0;
  public static final byte W = 1;
  private boolean X = true;
  private boolean Y;
  private boolean Z;
  private qb ab = new qb()
  {
    public void paint(Graphics2D paramAnonymousGraphics2D)
    {
      e locale = a();
      if (locale != null) {
        yf.this.a(paramAnonymousGraphics2D, yf.this.k().w(locale));
      }
    }
    
    public Rectangle getBounds()
    {
      e locale = a();
      if (locale != null) {
        return yf.this.b(yf.this.k().w(locale)).getBounds();
      }
      return new Rectangle(0, 0, -1, -1);
    }
    
    private e a()
    {
      Object localObject = yf.this.getGroupingDropTarget(yf.this.H, yf.this.I);
      if ((ld.E) || ((localObject instanceof e))) {
        return (e)localObject;
      }
      return null;
    }
  };
  private bb bb;
  private bb cb;
  private boolean db;
  private boolean eb;
  private Map fb;
  private Rectangle2D.Double[] gb;
  private boolean hb;
  private bb ib;
  private Set jb = Collections.EMPTY_SET;
  private int kb = 2;
  boolean lb;
  public static boolean mb;
  
  public boolean v()
  {
    return this.hb;
  }
  
  public void g(boolean paramBoolean)
  {
    this.hb = paramBoolean;
  }
  
  public void b(boolean paramBoolean)
  {
    if (!paramBoolean) {
      x().g();
    }
    super.b(paramBoolean);
    x().a(this.i);
  }
  
  public int w()
  {
    return this.kb;
  }
  
  public void d(int paramInt)
  {
    this.kb = paramInt;
  }
  
  protected boolean c(MouseEvent paramMouseEvent)
  {
    if (!ld.E) {}
    return (paramMouseEvent.getModifiers() & w()) != 0;
  }
  
  public z x()
  {
    if (!ld.E) {
      if (this.S == null) {
        this.S = y();
      }
    }
    return this.S;
  }
  
  public void a(z paramz)
  {
    if (!ld.E) {
      if (this.S != null) {
        this.S.g();
      }
    }
    this.S = paramz;
  }
  
  protected z y()
  {
    return new z(this.i);
  }
  
  public boolean z()
  {
    return this.T;
  }
  
  public void h(boolean paramBoolean)
  {
    this.T = paramBoolean;
  }
  
  public yf(df paramdf)
  {
    super(paramdf);
  }
  
  public yf() {}
  
  public void mouseShiftPressedLeft(double paramDouble1, double paramDouble2)
  {
    j localj = F();
    if (localj != null) {
      if (ld.E) {}
    }
    this.db = (isGroupReassignmentEnabled());
    b(paramDouble1, paramDouble2, this.db);
  }
  
  public void mousePressedLeft(double paramDouble1, double paramDouble2)
  {
    this.db = false;
    b(paramDouble1, paramDouble2, false);
  }
  
  public void mouseShiftReleasedLeft(double paramDouble1, double paramDouble2)
  {
    this.eb = (this.lb = isGroupReassignmentEnabled());
    b(paramDouble1, paramDouble2);
    this.eb = false;
  }
  
  public void mouseReleasedLeft(double paramDouble1, double paramDouble2)
  {
    this.lb = this.db;
    b(paramDouble1, paramDouble2);
  }
  
  private void b(double paramDouble1, double paramDouble2)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (!bool2)
    {
      if (z())
      {
        if (bool2) {
          break label92;
        }
        if (!c(this.v))
        {
          if (bool2) {
            break label98;
          }
          localObject1 = x().b(new a.d.w(paramDouble1, paramDouble2));
          paramDouble1 = ((a.d.w)localObject1).a;
          paramDouble2 = ((a.d.w)localObject1).b;
          if (!bool1) {
            break label97;
          }
        }
      }
      x().i();
      paramDouble1 = a(paramDouble1);
    }
    label92:
    paramDouble2 = b(paramDouble2);
    label97:
    label98:
    Object localObject1 = k();
    this.i.L();
    this.i.e(0);
    Object localObject2;
    Object localObject3;
    Object localObject4;
    if (!bool2) {
      if (this.R != null)
      {
        localObject2 = this.R.f();
        do
        {
          if (localObject2 == null) {
            break;
          }
          localObject3 = (d)((v)localObject2).c();
          localObject4 = ((g)localObject1).t((d)localObject3);
          if (bool1) {
            break label214;
          }
          if (this.jb.contains(localObject3)) {
            cg.a((tb)localObject4);
          }
          localObject2 = ((v)localObject2).a();
        } while (!bool1);
        if (bool2) {
          break label479;
        }
        this.R = null;
      }
    }
    if (this.hb)
    {
      label214:
      localObject2 = new HashSet();
      localObject3 = k().R();
      do
      {
        if (!((a.c.w)localObject3).e()) {
          break;
        }
        ((Set)localObject2).addAll(new ab(((a.c.w)localObject3).d().l()));
        ((a.c.w)localObject3).f();
        if ((!bool2) && (bool1)) {
          break label394;
        }
      } while (!bool1);
      if (!bool2)
      {
        if ((bool2) || (this.L != null))
        {
          localObject3 = this.L.iterator();
          do
          {
            do
            {
              do
              {
                if (!((Iterator)localObject3).hasNext()) {
                  break;
                }
                localObject4 = (z.q_)((Iterator)localObject3).next();
              } while (!(localObject4 instanceof z.r_));
              ((Set)localObject2).add(((z.r_)localObject4).e().a());
              if (bool2) {
                break label477;
              }
              if ((!bool2) && (bool1)) {
                return;
              }
            } while (bool2);
          } while (!bool1);
        }
        label394:
        cg.a((g)localObject1, (Collection)localObject2);
      }
    }
    else
    {
      I();
      x().g();
      b(paramDouble1 - this.m, paramDouble2 - this.G, paramDouble1, paramDouble2);
      this.i.a(this.M);
      this.M = null;
      ((g)localObject1).gb();
      a(false);
      g();
      this.K = null;
      this.jb = Collections.EMPTY_SET;
      this.L = null;
    }
    label477:
    label479:
    this.gb = null;
  }
  
  private void A()
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    g localg;
    if (((!bool2) && (this.i == null)) || ((localg = this.i.a()) == null)) {
      return;
    }
    if (!bool2) {
      if (this.N != 1) {
        n.a("Unexpected BracketCounter in MoveSelectionMode : " + this.N);
      }
    }
    do
    {
      while (!bool1)
      {
        if (this.N <= 0) {
          break;
        }
        this.N -= 1;
        localg.A();
      }
    } while (bool2);
  }
  
  public void g()
  {
    A();
    super.g();
  }
  
  public void mouseDraggedLeft(double paramDouble1, double paramDouble2)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (!bool2)
    {
      if (z())
      {
        if (bool2) {
          break label91;
        }
        if (!c(this.t))
        {
          a.d.w localw = x().b(new a.d.w(paramDouble1, paramDouble2));
          paramDouble1 = localw.a;
          paramDouble2 = localw.b;
          if (bool2) {
            break label101;
          }
          if (!bool1) {
            break label97;
          }
        }
      }
      paramDouble1 = a(paramDouble1);
      paramDouble2 = b(paramDouble2);
    }
    label91:
    x().i();
    label97:
    label101:
    if (((bool2) || (this.J)) && ((bool2) || (D()))) {
      if (!bool2)
      {
        if (d())
        {
          this.J = false;
          this.H = paramDouble1;
          this.I = paramDouble2;
          if (bool2) {
            return;
          }
        }
      }
      else {
        if (!bool1) {
          break label229;
        }
      }
    }
    double d1 = paramDouble1 - this.H;
    double d2 = paramDouble2 - this.I;
    if (!bool2)
    {
      if ((d1 != 0.0D) || (d2 != 0.0D))
      {
        this.H = paramDouble1;
        this.I = paramDouble2;
        c(paramDouble1 - this.m, paramDouble2 - this.G);
      }
    }
    else {
      a(d1, d2, paramDouble1, paramDouble2);
    }
    label229:
    this.i.b();
  }
  
  private void c(double paramDouble1, double paramDouble2)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (!bool2) {
      if (this.K == null) {
        return;
      }
    }
    g localg = k();
    v localv = this.K.f();
    Object localObject;
    do
    {
      if (localv == null) {
        break;
      }
      localObject = (e)localv.c();
      try
      {
        Rectangle2D.Double localDouble = this.gb[localObject.f()];
        ld localld = localg.w((e)localObject);
        localld.a(localDouble.x + paramDouble1, localDouble.y + paramDouble2);
      }
      catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException) {}catch (NullPointerException localNullPointerException2) {}
      localv = localv.a();
    } while (!bool1);
    int i = 0;
    if (i < this.L.size()) {}
    for (;;)
    {
      try
      {
        localObject = (z.q_)this.L.get(i);
        ((z.q_)localObject).b(paramDouble1, paramDouble2);
        if (bool1) {
          return;
        }
      }
      catch (NullPointerException localNullPointerException1) {}
      i++;
      if (!bool1) {
        break;
      }
      if (!bool2) {
        G();
      }
    }
  }
  
  private void a(ld paramld)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    e locale = paramld.n();
    g localg = k();
    d locald = locale.h();
    do
    {
      do
      {
        if (locald == null) {
          break;
        }
        if (bool1) {
          break label103;
        }
        if (this.jb.contains(locald)) {
          ud.a(this.i, localg.t(locald), true);
        }
        locald = locald.i();
      } while (!bool1);
    } while (bool2);
    locald = locale.i();
    label103:
    do
    {
      while (!bool1)
      {
        if (locald == null) {
          break;
        }
        if (this.jb.contains(locald)) {
          ud.a(this.i, localg.t(locald), false);
        }
        locald = locald.j();
      }
    } while (bool2);
  }
  
  protected void d(double paramDouble1, double paramDouble2) {}
  
  protected void a(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
  {
    if ((ld.E) || (this.bb != null)) {
      a(this.bb);
    }
  }
  
  private void a(bb parambb)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    g localg = k();
    if (getGroupBoundsPolicy() == 1)
    {
      v localv = parambb.f();
      do
      {
        if (localv == null) {
          break;
        }
        e locale = (e)localv.c();
        ld localld = localg.w(locale);
        b localb = localld.K();
        if (!bool2)
        {
          if (localb != null)
          {
            Rectangle2D localRectangle2D1 = (Rectangle2D)this.fb.get(locale);
            Rectangle2D localRectangle2D2 = localb.f();
            double d1 = Math.max(0.0D, localRectangle2D2.getX() - localRectangle2D1.getX());
            double d2 = Math.max(0.0D, localRectangle2D2.getY() - localRectangle2D1.getY());
            double d3 = Math.max(0.0D, localRectangle2D1.getMaxX() - localRectangle2D2.getMaxX());
            double d4 = Math.max(0.0D, localRectangle2D1.getMaxY() - localRectangle2D2.getMaxY());
            localb.a(new a.d.u(d2, d1, d4, d3));
          }
          localv = localv.a();
        }
      } while (!bool1);
    }
  }
  
  protected void b(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    j localj = F();
    if (!bool2)
    {
      if (localj != null)
      {
        g localg = k();
        if (!bool2) {
          if (!this.eb)
          {
            if (bool2) {
              break label448;
            }
            if (!this.db) {
              break label447;
            }
          }
        }
        Object localObject1 = getGroupingDropTarget(paramDouble3, paramDouble4);
        if (bool2) {
          return;
        }
        if (localObject1 != null)
        {
          bb localbb = new bb();
          Object localObject2 = this.cb.l();
          Object localObject3;
          do
          {
            if (!((a.c.w)localObject2).e()) {
              break;
            }
            localObject3 = ((a.c.w)localObject2).d();
            if (bool1) {
              break label155;
            }
            if (((e)localObject3).g() == localg) {
              localbb.add(localObject3);
            }
            ((a.c.w)localObject2).f();
          } while (!bool1);
          if (!bool2)
          {
            label155:
            if (bool2) {
              break label422;
            }
            if ((localObject1 instanceof e))
            {
              localObject2 = (e)localObject1;
              localj.c(localbb, (e)localObject2);
              localObject3 = new bb();
              ((bb)localObject3).add(localObject1);
              e locale = (e)localObject1;
              do
              {
                if ((locale = localj.p(locale)) == null) {
                  break;
                }
                if (bool1) {
                  break label297;
                }
                if (locale.g() != localg) {
                  break;
                }
                ((bb)localObject3).add(locale);
              } while (!bool1);
              localg.a(((bb)localObject3).l());
              if (!bool2) {
                if (!bool2)
                {
                  if (this.fb != null)
                  {
                    if (bool2) {
                      break label409;
                    }
                    if (getGroupBoundsPolicy() != 0) {}
                  }
                }
                else
                {
                  label297:
                  Rectangle2D localRectangle2D = (Rectangle2D)this.fb.get(localObject2);
                  Object localObject4 = localg.w((e)localObject2).O();
                  localObject4 = ((Rectangle2D)localObject4).createUnion(localRectangle2D);
                  ld localld = localg.w((e)localObject2);
                  b localb = localld.K();
                  if ((bool2) || (localb != null))
                  {
                    if (!bool2) {
                      if (localb.e())
                      {
                        if (!bool2) {
                          if (localj.r((e)localObject2).e()) {
                            break label408;
                          }
                        }
                      }
                      else
                      {
                        localld.a((Rectangle2D)localObject4);
                        if (bool2) {
                          break label414;
                        }
                      }
                    }
                    if (!bool1) {}
                  }
                  else
                  {
                    localld.a((Rectangle2D)localObject4);
                  }
                }
              }
              label408:
              label409:
              a((bb)localObject3);
              label414:
              break label442;
            }
          }
          if ((localObject1 instanceof g)) {
            label422:
            localj.c(localbb, localj.f((a.c.q)localObject1));
          }
          label442:
          localg.gb();
        }
      }
      label447:
      label448:
      j(this.lb);
    }
  }
  
  protected bb B()
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    bb localbb = new bb();
    g localg = k();
    a.c.w localw = localg.v();
    if (localw.e()) {
      if (!bool2) {
        if (!localg.y(localw.d())) {}
      }
    }
    while (bool2)
    {
      localbb.add(localw.d());
      localw.f();
      if (!bool1) {
        break;
      }
    }
    return localbb;
  }
  
  protected h C()
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    h localh = new h();
    g localg = k();
    fb localfb = localg.L();
    do
    {
      if (!localfb.e()) {
        break;
      }
      eb localeb = localfb.a();
      if (!bool2)
      {
        if (localg.a(localeb)) {
          localh.b(localeb);
        }
        localfb.f();
      }
    } while (!bool1);
    return localh;
  }
  
  private void a(bb parambb, h paramh)
  {
    boolean bool = ld.E;
    j localj = F();
    if (!bool)
    {
      if (localj == null)
      {
        this.bb = null;
        this.cb = null;
        parambb.addAll(B());
        paramh.addAll(C());
        if (!bool) {
          if (!ld.D) {
            return;
          }
        }
      }
      else
      {
        this.bb = new bb();
        this.cb = B();
        parambb.addAll(this.cb);
      }
      paramh.addAll(C());
    }
    else
    {
      a(parambb, this.bb, paramh);
    }
  }
  
  protected void a(bb parambb1, bb parambb2, h paramh)
  {
    HashSet localHashSet1 = new HashSet(parambb1);
    HashSet localHashSet2 = new HashSet(paramh);
    ke.a(k(), new a.i.u()new a.i.u
    {
      private final Set val$ns;
      
      public boolean a(Object paramAnonymousObject)
      {
        return this.val$ns.contains(paramAnonymousObject);
      }
    }, new a.i.u()
    {
      private final Set val$bs;
      
      public boolean a(Object paramAnonymousObject)
      {
        return this.val$bs.contains(paramAnonymousObject);
      }
    }, parambb1, parambb2, paramh);
  }
  
  void b(double paramDouble1, double paramDouble2, boolean paramBoolean)
  {
    boolean bool4 = ld.E;
    boolean bool3 = ld.D;
    g localg = k();
    a(true);
    this.J = true;
    paramDouble1 = a(paramDouble1);
    paramDouble2 = b(paramDouble2);
    this.m = (this.H = paramDouble1);
    this.G = (this.I = paramDouble2);
    this.i.b();
    this.M = this.i.O();
    this.i.a(Cursor.getPredefinedCursor(13));
    this.K = new bb();
    h localh = new h();
    a(this.K, localh);
    localg.z();
    this.N += 1;
    localg.b((byte)1);
    HashSet localHashSet = new HashSet(this.K);
    this.jb = new HashSet();
    ArrayList localArrayList1 = new ArrayList();
    ArrayList localArrayList2 = new ArrayList();
    int i = 0;
    Object localObject1 = localg.w();
    while (((m)localObject1).e())
    {
      localObject2 = ((m)localObject1).a();
      boolean bool1 = a((d)localObject2);
      if (!bool4)
      {
        if (bool1) {
          this.jb.add(localObject2);
        }
        i += localg.t((d)localObject2).n();
        ((m)localObject1).f();
      }
      if (bool3)
      {
        if (!bool4) {}
        a.c.q.n = !a.c.q.n;
      }
    }
    localObject1 = localh.f();
    Object localObject4;
    do
    {
      if (localObject1 == null) {
        break;
      }
      localObject2 = (eb)((v)localObject1).c();
      localObject3 = ((eb)localObject2).a();
      if (bool4) {
        break label478;
      }
      if (bool3) {
        break label468;
      }
      if (!bool4)
      {
        if (this.jb.contains(localObject3))
        {
          this.jb.add(localObject3);
          localObject4 = localg.t((d)localObject3);
          if (!bool4) {
            if ((((tb)localObject4).p() == localObject2) && ((bool4) || (!localHashSet.contains(((d)localObject3).e())))) {
              localArrayList1.add(localObject3);
            }
          }
          if (((tb)localObject4).q() == localObject2)
          {
            if (bool4) {
              continue;
            }
            if (!localHashSet.contains(((d)localObject3).f())) {
              localArrayList2.add(localObject3);
            }
          }
        }
        localObject1 = ((v)localObject1).a();
      }
    } while (!bool3);
    if (!bool4) {
      label468:
      this.R = new ab();
    }
    label478:
    localObject1 = new ArrayList();
    Object localObject2 = new HashSet(localh);
    Object localObject3 = this.jb.iterator();
    do
    {
      do
      {
        int n;
        do
        {
          if (!((Iterator)localObject3).hasNext()) {
            break;
          }
          localObject4 = (d)((Iterator)localObject3).next();
          localObject5 = localg.t((d)localObject4);
          n = ((tb)localObject5).n();
        } while (n != 0);
        if ((bool4) || ((!bool4) && (bool3))) {
          break label621;
        }
      } while (localHashSet.contains(((d)localObject4).e()) == localHashSet.contains(((d)localObject4).f()));
      if (bool4) {
        break label616;
      }
      ((List)localObject1).add(localObject4);
    } while (!bool3);
    label616:
    if (!((List)localObject1).isEmpty()) {
      label621:
      localg.a(new ab(((List)localObject1).iterator()).l());
    }
    localObject3 = new HashSet(localArrayList1);
    ((Set)localObject3).addAll(localArrayList2);
    if (!bool4) {
      if (!((Set)localObject3).isEmpty()) {
        localg.a(new ab(((Set)localObject3).iterator()).l());
      }
    }
    localObject3 = new byte[i];
    int j = 0;
    Object localObject5 = localg.w();
    Object localObject9;
    Object localObject10;
    label951:
    label994:
    label1023:
    do
    {
      if (!((m)localObject5).e()) {
        break;
      }
      d locald = ((m)localObject5).a();
      boolean bool2 = this.jb.contains(locald);
      if (bool3) {
        break label1041;
      }
      int i3 = 0;
      localObject9 = localg.t(locald).o();
      do
      {
        do
        {
          if (!((fb)localObject9).e()) {
            break label1023;
          }
          localObject10 = ((fb)localObject9).a();
          ((fb)localObject9).f();
          if (bool3) {
            break;
          }
          if (((Set)localObject2).contains(localObject10))
          {
            tmp819_817 = j;
            tmp819_815 = localObject3;
            tmp819_815[tmp819_817] = ((byte)(tmp819_815[tmp819_817] | 0x1));
            if (bool4) {
              break label994;
            }
            if (bool2)
            {
              if (!bool4) {
                if (i3 > 0)
                {
                  tmp851_850 = (j - 1);
                  tmp851_845 = localObject3;
                  tmp851_845[tmp851_850] = ((byte)(tmp851_845[tmp851_850] | 0x2));
                }
              }
              if (bool4) {
                break label994;
              }
              if (((fb)localObject9).e())
              {
                tmp878_877 = (j + 1);
                tmp878_872 = localObject3;
                tmp878_872[tmp878_877] = ((byte)(tmp878_872[tmp878_877] | 0x4));
                if (bool4) {
                  break label994;
                }
                if (!bool3) {}
              }
            }
          }
          else
          {
            if (bool4) {
              break label994;
            }
            if (bool2)
            {
              if (!bool4) {
                if (i3 == 0)
                {
                  if (bool4) {
                    break label951;
                  }
                  if (localHashSet.contains(locald.e()))
                  {
                    tmp938_936 = j;
                    tmp938_934 = localObject3;
                    tmp938_934[tmp938_936] = ((byte)(tmp938_934[tmp938_936] | 0x4));
                  }
                }
              }
              if (bool4) {
                break label994;
              }
              if (!((fb)localObject9).e())
              {
                if (bool4) {
                  break label994;
                }
                if (localHashSet.contains(locald.f()))
                {
                  tmp983_981 = j;
                  tmp983_979 = localObject3;
                  tmp983_979[tmp983_981] = ((byte)(tmp983_979[tmp983_981] | 0x2));
                }
              }
            }
          }
          if (!bool4)
          {
            if (localObject3[j] != 0) {
              this.R.add(locald);
            }
            j++;
            i3++;
          }
        } while (!bool3);
        ((m)localObject5).f();
      } while (bool4);
    } while (!bool3);
    label1041:
    int k = 0;
    int i1 = 0;
    do
    {
      if (i1 >= localObject3.length) {
        break;
      }
      int i2 = localObject3[i1];
      if (bool4) {
        break label1149;
      }
      if (bool3) {
        break label1147;
      }
      if (i2 > 0) {
        k++;
      }
      i1++;
    } while (!bool3);
    localg.a(this.R.l());
    this.L = new ArrayList(k + ((List)localObject1).size() + localArrayList1.size() + localArrayList2.size());
    localh.clear();
    if (!bool4) {
      label1147:
      j = 0;
    }
    label1149:
    Object localObject6 = localg.w();
    Object localObject7;
    Object localObject8;
    double d5;
    label1476:
    label1480:
    label1659:
    label1661:
    do
    {
      if (!((m)localObject6).e()) {
        break;
      }
      localObject7 = localg.t(((m)localObject6).a());
      localObject8 = null;
      if (bool4) {
        break label2897;
      }
      if (bool3) {
        break label2896;
      }
      localObject9 = ((tb)localObject7).o();
      do
      {
        do
        {
          if (!((fb)localObject9).e()) {
            break label1719;
          }
          localObject10 = ((fb)localObject9).a();
          ((fb)localObject9).f();
          int i4 = localObject3[j];
          if (bool3) {
            break;
          }
          if (i4 != 0)
          {
            localh.add(localObject10);
            byte b = 0;
            if (!bool4) {
              if ((i4 & 0x1) != 0)
              {
                b = 3;
                if (bool4) {
                  break label1661;
                }
                if (!bool3) {
                  break label1659;
                }
              }
            }
            Object localObject13;
            zd localzd;
            double d8;
            if (!bool4)
            {
              if ((i4 & 0x2) == 2) {
                if ((bool4) || (((fb)localObject9).e()))
                {
                  localObject13 = ((fb)localObject9).a();
                  if (!bool4) {
                    if (((eb)localObject13).b() == ((eb)localObject10).b())
                    {
                      b = (byte)(b | 0x1);
                      if (bool4) {
                        break label1480;
                      }
                      if (!bool3) {
                        break label1476;
                      }
                    }
                  }
                  if (bool4) {
                    break label1480;
                  }
                  if (((eb)localObject13).c() == ((eb)localObject10).c())
                  {
                    b = (byte)(b | 0x2);
                    if (bool4) {
                      break label1480;
                    }
                    if (!bool3) {}
                  }
                }
                else
                {
                  localObject13 = ((tb)localObject7).g();
                  localzd = ((tb)localObject7).l();
                  d5 = localzd.a((ld)localObject13);
                  d8 = localzd.b((ld)localObject13);
                  if (!bool4) {
                    if (d5 == ((eb)localObject10).b())
                    {
                      b = (byte)(b | 0x1);
                      if (bool4) {
                        break label1480;
                      }
                      if (!bool3) {
                        break label1476;
                      }
                    }
                  }
                  if (bool4) {
                    break label1480;
                  }
                  if (d8 == ((eb)localObject10).c()) {
                    b = (byte)(b | 0x2);
                  }
                }
              }
              if (bool4) {}
            }
            else if ((i4 & 0x4) == 4)
            {
              if (!bool4) {
                if (localObject8 == null)
                {
                  localObject13 = ((tb)localObject7).h();
                  localzd = ((tb)localObject7).k();
                  d5 = localzd.a((ld)localObject13);
                  d8 = localzd.b((ld)localObject13);
                  if (!bool4) {
                    if (d5 == ((eb)localObject10).b())
                    {
                      b = (byte)(b | 0x1);
                      if (bool4) {
                        break label1661;
                      }
                      if (!bool3) {
                        break label1659;
                      }
                    }
                  }
                  if (bool4) {
                    break label1661;
                  }
                  if (d8 != ((eb)localObject10).c()) {
                    break label1659;
                  }
                  b = (byte)(b | 0x2);
                  if (bool4) {
                    break label1661;
                  }
                  if (!bool3) {
                    break label1659;
                  }
                }
              }
              if (!bool4) {
                if (((eb)localObject8).b() == ((eb)localObject10).b())
                {
                  b = (byte)(b | 0x1);
                  if (bool4) {
                    break label1661;
                  }
                  if (!bool3) {
                    break label1659;
                  }
                }
              }
              if (bool4) {
                break label1661;
              }
              if (((eb)localObject8).c() == ((eb)localObject10).c()) {
                b = (byte)(b | 0x2);
              }
            }
            if (bool4) {
              continue;
            }
            if (b != 0) {
              this.L.add(new z.r_((eb)localObject10, new a.d.w(((eb)localObject10).b(), ((eb)localObject10).c()), b));
            }
          }
          localObject8 = localObject10;
          j++;
        } while (!bool3);
        ((m)localObject6).f();
      } while (bool4);
    } while (!bool3);
    label1719:
    if (!bool4)
    {
      localObject6 = ((List)localObject1).iterator();
      double d3;
      double d4;
      eb localeb1;
      eb localeb2;
      label2112:
      do
      {
        do
        {
          if (!((Iterator)localObject6).hasNext()) {
            break;
          }
          localObject7 = (d)((Iterator)localObject6).next();
          localObject8 = localg.t((d)localObject7);
          localObject9 = localg.r((d)localObject7);
          localObject10 = localg.s((d)localObject7);
          d3 = ((a.d.w)localObject9).a - ((a.d.w)localObject10).a;
          d4 = ((a.d.w)localObject9).b - ((a.d.w)localObject10).b;
          if (bool3) {
            break label2148;
          }
          if (Math.abs(d3) > Math.abs(d4))
          {
            d5 = a((((a.d.w)localObject9).a + ((a.d.w)localObject10).a) * 0.5D);
            localeb1 = ((tb)localObject8).c(d5, ((a.d.w)localObject9).b);
            localeb2 = ((tb)localObject8).c(d5, ((a.d.w)localObject10).b);
            if (!bool4)
            {
              if (this.K.contains(((d)localObject7).e()))
              {
                this.L.add(new z.r_(localeb1, localeb1.e(), (byte)2));
                if (bool4) {
                  continue;
                }
                if (!bool3) {}
              }
              else
              {
                this.L.add(new z.r_(localeb2, localeb2.e(), (byte)2));
              }
            }
            else
            {
              if (bool4) {
                continue;
              }
              if (!bool3) {}
            }
          }
          else
          {
            d5 = b((((a.d.w)localObject9).b + ((a.d.w)localObject10).b) * 0.5D);
            localeb1 = ((tb)localObject8).c(((a.d.w)localObject9).a, d5);
            localeb2 = ((tb)localObject8).c(((a.d.w)localObject10).a, d5);
            if (!bool4) {
              if (this.K.contains(((d)localObject7).e()))
              {
                this.L.add(new z.r_(localeb1, localeb1.e(), (byte)1));
                if (bool4) {
                  continue;
                }
                if (!bool3) {
                  break label2112;
                }
              }
            }
            this.L.add(new z.r_(localeb2, localeb2.e(), (byte)1));
          }
          this.R.add(localObject7);
        } while (!bool3);
      } while (bool4);
      localObject6 = localArrayList1.iterator();
      label2148:
      if (((Iterator)localObject6).hasNext()) {}
      label2285:
      while (bool4)
      {
        localObject7 = (d)((Iterator)localObject6).next();
        localObject8 = localg.t((d)localObject7);
        localObject9 = ((tb)localObject8).p();
        localObject10 = localg.r((d)localObject7);
        d3 = ((a.d.w)localObject10).a - ((eb)localObject9).b();
        d4 = ((a.d.w)localObject10).b - ((eb)localObject9).c();
        int i5 = 1;
        if ((!bool4) && (bool3)) {
          break label2602;
        }
        if (((tb)localObject8).n() == 1)
        {
          if (bool4) {
            break label2285;
          }
          if (((d)localObject7).g())
          {
            if (bool4) {
              break label2285;
            }
            if (localArrayList2.contains(localObject7)) {
              i5 = 0;
            }
          }
        }
        if (!bool4) {
          if (Math.abs(d3) > Math.abs(d4))
          {
            d7 = a((((eb)localObject9).b() + ((a.d.w)localObject10).a()) * 0.5D);
            ((tb)localObject8).a(d7, ((a.d.w)localObject10).b, (eb)localObject9, 1);
            localeb2 = ((tb)localObject8).a(d7, ((eb)localObject9).c(), (eb)localObject9, 1);
            if (!bool4)
            {
              if (i5 != 0) {
                this.L.add(new z.r_(localeb2, localeb2.e(), (byte)2));
              }
            }
            else {
              if (!bool3) {
                break;
              }
            }
            localeb3 = ((tb)localObject8).a(((eb)localObject9).b(), ((eb)localObject9).c(), (eb)localObject9, 1);
            this.L.add(new z.r_(localeb3, localeb3.e(), (byte)1));
            if (bool4) {
              break label2493;
            }
            if (!bool3) {
              break;
            }
          }
        }
        double d7 = b((((eb)localObject9).c() + ((a.d.w)localObject10).b()) * 0.5D);
        ((tb)localObject8).a(((a.d.w)localObject10).a, d7, (eb)localObject9, 1);
        localeb2 = ((tb)localObject8).a(((eb)localObject9).b(), d7, (eb)localObject9, 1);
        if (!bool4)
        {
          if (i5 != 0) {
            this.L.add(new z.r_(localeb2, localeb2.e(), (byte)1));
          }
        }
        else {
          if (!bool3) {
            break;
          }
        }
        eb localeb3 = ((tb)localObject8).a(((eb)localObject9).b(), ((eb)localObject9).c(), (eb)localObject9, 1);
        this.L.add(new z.r_(localeb3, localeb3.e(), (byte)2));
        if (!bool3) {
          break;
        }
      }
      label2493:
      localObject6 = localArrayList2.iterator();
      if (((Iterator)localObject6).hasNext()) {}
      while (bool4)
      {
        localObject7 = (d)((Iterator)localObject6).next();
        localObject8 = localg.t((d)localObject7);
        localObject9 = ((tb)localObject8).q();
        localObject10 = localg.s((d)localObject7);
        d3 = ((a.d.w)localObject10).a - ((eb)localObject9).b();
        d4 = ((a.d.w)localObject10).b - ((eb)localObject9).c();
        if (!bool4) {
          if (Math.abs(d3) > Math.abs(d4))
          {
            d6 = a((((eb)localObject9).b() + ((a.d.w)localObject10).a()) * 0.5D);
            ((tb)localObject8).a(d6, ((a.d.w)localObject10).b, (eb)localObject9, 0);
            localeb1 = ((tb)localObject8).a(d6, ((eb)localObject9).c(), (eb)localObject9, 0);
            this.L.add(new z.r_(localeb1, localeb1.e(), (byte)2));
            if (bool4) {
              break label2857;
            }
            if (!bool3) {
              break;
            }
          }
        }
        double d6 = b((((eb)localObject9).c() + ((a.d.w)localObject10).b()) * 0.5D);
        ((tb)localObject8).a(((a.d.w)localObject10).a, d6, (eb)localObject9, 0);
        localeb1 = ((tb)localObject8).a(((eb)localObject9).b(), d6, (eb)localObject9, 0);
        this.L.add(new z.r_(localeb1, localeb1.e(), (byte)1));
        if (!bool3) {
          break;
        }
      }
      localObject6 = this.R.l();
      if (!((m)localObject6).e()) {
        break label2922;
      }
    }
    label2602:
    label2896:
    label2897:
    label2922:
    while (bool4)
    {
      localg.t(((m)localObject6).a()).a((byte)0);
      ((m)localObject6).f();
      if ((!bool4) && (bool3)) {
        break label2941;
      }
      if (!bool3) {
        break;
      }
    }
    label2857:
    k().a(this.K.l());
    label2941:
    localObject6 = this.K.l();
    if (((a.c.w)localObject6).e())
    {
      localg.w(((a.c.w)localObject6).d()).a((byte)0, true);
      ((a.c.w)localObject6).f();
    }
    for (;;)
    {
      if ((bool4) || (!bool3))
      {
        if (!bool3) {
          break;
        }
        this.i.e(3);
        i(paramBoolean);
        if (!bool4) {
          this.gb = new Rectangle2D.Double[localg.j()];
        }
      }
    }
    localObject6 = null;
    double d1 = 0.0D;
    double d2 = 0.0D;
    Object localObject12;
    if ((bool4) || (this.K.size() + this.L.size() == 1))
    {
      if (!bool4)
      {
        if (!d()) {
          break label3238;
        }
        if (bool4) {}
      }
      else if (this.K.size() == 1)
      {
        localObject11 = localg.w(this.K.m());
        d1 = ((ld)localObject11).A();
        d2 = ((ld)localObject11).B();
        ((ld)localObject11).c(a(d1), b(d2));
        a((ld)localObject11);
        localObject6 = localObject11;
        break label3238;
      }
      localObject11 = (z.r_)this.L.get(0);
      localObject12 = ((z.r_)localObject11).e();
      d1 = ((eb)localObject12).b();
      d2 = ((eb)localObject12).c();
      ((eb)localObject12).a(a(d1), b(d2));
      localObject6 = localObject12;
      this.L.set(0, new z.r_((eb)localObject12, ((eb)localObject12).e(), ((z.r_)localObject11).a));
    }
    label3238:
    Object localObject11 = this.K.l();
    do
    {
      do
      {
        if (!((a.c.w)localObject11).e()) {
          break;
        }
        localObject12 = ((a.c.w)localObject11).d();
        if (bool3) {
          break label3431;
        }
        if ((localObject12 != null) && (((e)localObject12).g() != null))
        {
          ld localld = localg.w((e)localObject12);
          this.gb[localObject12.f()] = new Rectangle2D.Double(localld.a(), localld.b(), localld.c(), localld.d());
        }
        ((a.c.w)localObject11).f();
      } while (!bool3);
      if (bool4) {
        break;
      }
    } while (bool4);
    if (z())
    {
      x().a(new a.d.w(paramDouble1, paramDouble2), this.K, this.L, Collections.EMPTY_SET, a.i.q.b(this.gb));
      if (bool4) {
        break label3424;
      }
      if (d()) {
        x().a(new ve((1.0D / 0.0D))
        {
          public byte a(a.d.w paramAnonymousw, Point2D.Double paramAnonymousDouble, byte paramAnonymousByte)
          {
            if (!ld.E) {
              if (yf.this.d())
              {
                double d1 = paramAnonymousw.a;
                double d2 = paramAnonymousw.b;
                double d3 = yf.this.a(d1);
                double d4 = yf.this.b(d2);
                paramAnonymousDouble.x = d3;
                paramAnonymousDouble.y = d4;
                return 3;
              }
            }
            return paramAnonymousByte;
          }
          
          public boolean a(a.d.w paramAnonymousw1, a.d.w paramAnonymousw2, byte paramAnonymousByte)
          {
            return yf.this.d();
          }
        });
      }
    }
    label3424:
    d(paramDouble1, paramDouble2);
    if (localObject6 != null)
    {
      label3431:
      if (!bool4) {
        if ((localObject6 instanceof ld))
        {
          localObject11 = (ld)localObject6;
          if ((bool4) || (d1 == ((ld)localObject11).A()))
          {
            if (bool4) {
              break label3518;
            }
            if (d2 == ((ld)localObject11).B()) {}
          }
          else
          {
            a(((ld)localObject11).A() - d1, ((ld)localObject11).B() - d2, paramDouble1, paramDouble2);
          }
        }
      }
      if ((bool4) || ((localObject6 instanceof eb)))
      {
        label3518:
        localObject11 = (eb)localObject6;
        if ((bool4) || ((d1 != ((eb)localObject11).b()) || (d2 != ((eb)localObject11).c()))) {
          a(((eb)localObject11).b() - d1, ((eb)localObject11).c() - d2, paramDouble1, paramDouble2);
        }
      }
    }
    if (bool4) {
      a.c.q.o = !a.c.q.o;
    }
  }
  
  protected boolean a(d paramd)
  {
    return qf.a(paramd, k());
  }
  
  private boolean D()
  {
    boolean bool = ld.E;
    if (!bool) {}
    return ((bool) || (this.L != null) ? this.L.size() : 0) + ((bool) || (this.K != null) ? this.K.size() : 0) == 1;
  }
  
  public void b()
    throws UnsupportedOperationException
  {
    boolean bool = ld.E;
    x().g();
    if (!bool)
    {
      if (a())
      {
        b(this.H - this.m, this.I - this.G, this.H, this.I);
        I();
        this.i.e(0);
      }
    }
    else
    {
      if (!bool)
      {
        if (this.M != null)
        {
          this.i.a(this.M);
          this.M = null;
        }
        this.i.a().gb();
        a(false);
        g();
        this.K = null;
        this.jb = Collections.EMPTY_SET;
        this.L = null;
      }
      this.gb = null;
    }
  }
  
  protected Object getGroupingDropTarget(double paramDouble1, double paramDouble2)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    g localg = k();
    sc localsc = e(paramDouble1, paramDouble2);
    if (!localsc.x()) {
      return localg;
    }
    j localj = F();
    y localy = localsc.e();
    do
    {
      if (!localy.e()) {
        break;
      }
      e locale = (e)localy.j();
      if (bool1) {
        break label122;
      }
      if (!bool2)
      {
        if (!localg.y(locale))
        {
          if (bool2) {
            continue;
          }
          if (localj.m(locale)) {
            return locale;
          }
        }
        localy.f();
      }
    } while (!bool1);
    label122:
    return localg;
  }
  
  protected sc e(double paramDouble1, double paramDouble2)
  {
    return new sc(this.i, paramDouble1, paramDouble2, false, 4);
  }
  
  protected j F()
  {
    return j.a(k());
  }
  
  public byte getGroupBoundsPolicy()
  {
    return this.U;
  }
  
  public void setGroupBoundsPolicy(byte paramByte)
  {
    this.U = paramByte;
  }
  
  public boolean isGroupReassignmentEnabled()
  {
    return this.X;
  }
  
  public void setGroupReassignmentEnabled(boolean paramBoolean)
  {
    this.X = paramBoolean;
  }
  
  public boolean isIndicatingTargetGroup()
  {
    return this.Y;
  }
  
  public void setIndicatingTargetGroup(boolean paramBoolean)
  {
    this.Y = paramBoolean;
  }
  
  protected void a(Graphics2D paramGraphics2D, ld paramld)
  {
    xf.c(paramGraphics2D, paramld);
  }
  
  protected Rectangle2D b(ld paramld)
  {
    return new Rectangle2D.Double(paramld.a() - 10.0D, paramld.b() - 10.0D, paramld.c() + 20.0D, paramld.d() + 20.0D);
  }
  
  private void G()
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (!bool2) {
      if (isGroupReassignmentEnabled())
      {
        if (bool2) {
          break label122;
        }
        if (isIndicatingTargetGroup())
        {
          if (!bool2) {}
          MouseEvent localMouseEvent = this.t != null ? this.t : this.s;
          if ((bool2) || (localMouseEvent != null)) {
            if (bool2) {}
          }
          int i = (localMouseEvent.getModifiers() & 0x1) != 0 ? 1 : 0;
          if (!bool2) {
            if (i != 0)
            {
              H();
              if (!bool2) {
                if (!bool1) {
                  return;
                }
              }
            }
            else
            {
              if (bool2) {
                break label122;
              }
              I();
            }
          }
          if (!bool1) {
            return;
          }
        }
      }
    }
    label122:
    I();
  }
  
  private void H()
  {
    if (!ld.E)
    {
      if (!this.Z) {
        this.Z = true;
      }
    }
    else {
      this.i.a(this.ab);
    }
  }
  
  private void I()
  {
    if (!ld.E)
    {
      if (this.Z) {
        this.i.b(this.ab);
      }
    }
    else {
      this.Z = false;
    }
  }
  
  private void i(boolean paramBoolean)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    j localj = F();
    if (!bool2)
    {
      if (localj == null) {
        this.bb = null;
      }
    }
    else {
      return;
    }
    g localg = k();
    Object localObject2;
    if (!bool2)
    {
      if (this.bb != null)
      {
        localg.a(this.bb.l());
        localObject1 = this.bb.f();
        do
        {
          if (localObject1 == null) {
            break;
          }
          if (bool2) {
            break label132;
          }
          localObject2 = localg.w((e)((v)localObject1).c());
          ((ld)localObject2).a((byte)0, true);
          localObject1 = ((v)localObject1).a();
          if (bool1) {
            break label131;
          }
        } while (!bool1);
      }
      if (bool2) {}
    }
    else
    {
      this.fb = new HashMap();
    }
    label131:
    label132:
    Object localObject1 = localg.v();
    do
    {
      if (!((a.c.w)localObject1).e()) {
        break;
      }
      localObject2 = ((a.c.w)localObject1).d();
      if (bool1) {
        break label213;
      }
      if (localj.m((e)localObject2))
      {
        ld localld = localg.w((e)localObject2);
        this.fb.put(localObject2, localld.O());
      }
      ((a.c.w)localObject1).f();
    } while (!bool1);
    if ((!bool2) && (paramBoolean)) {
      label213:
      k(false);
    }
  }
  
  private void j(boolean paramBoolean)
  {
    if (paramBoolean) {
      k(true);
    }
    this.bb = null;
    this.cb = null;
    this.fb = null;
  }
  
  private void k(boolean paramBoolean)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    g localg = k();
    v localv;
    Object localObject1;
    Object localObject2;
    if (paramBoolean)
    {
      if ((!bool2) && (this.ib == null)) {
        return;
      }
      localv = this.ib.f();
      do
      {
        if (localv == null) {
          break;
        }
        localObject1 = localg.w((e)localv.c());
        localObject2 = ((ld)localObject1).K();
        if (bool2) {
          break label113;
        }
        if (bool1) {
          break label111;
        }
        if ((bool2) || (localObject2 != null)) {
          ((b)localObject2).a(true);
        }
        localv = localv.a();
      } while (!bool1);
      if (bool2) {
        break label117;
      }
      this.ib = null;
      label111:
      if (!bool1) {
        label113:
        return;
      }
    }
    label117:
    if ((bool2) || (this.bb != null))
    {
      if (!bool2) {
        if (this.ib == null) {
          this.ib = new bb();
        }
      }
      localv = this.bb.f();
      do
      {
        if (localv == null) {
          break;
        }
        localObject1 = (e)localv.c();
        localObject2 = localg.w((e)localObject1);
        b localb = ((ld)localObject2).K();
        if (!bool2)
        {
          if (localb != null)
          {
            if (bool2) {
              continue;
            }
            if (localb.e())
            {
              localb.a(false);
              this.ib.add(localObject1);
            }
          }
          localv = localv.a();
        }
      } while (!bool1);
    }
  }
  
  public void mouseReleased(MouseEvent paramMouseEvent)
  {
    super.mouseReleased(paramMouseEvent);
    this.db = false;
  }
  
  public void mouseReleasedRight(double paramDouble1, double paramDouble2)
  {
    mouseReleasedLeft(paramDouble1, paramDouble2);
  }
  
  public void mouseDraggedRight(double paramDouble1, double paramDouble2)
  {
    mouseDraggedLeft(paramDouble1, paramDouble2);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.yf

 * JD-Core Version:    0.7.0.1

 */